ws_path="/home/xhzn_taomin/HA_ws/src/hybrid_a_star_debug"
cd $ws_path

if [ ! -d "LOGS/" ]; then
	mkdir LOGS
else
	echo "LOGS文件夹已存在"
fi

day=$(date +'%m-%d')

if [ ! -d $day ]; then
	mkdir LOGS/$day
else
	echo "日期文件夹已存在"
fi

time=$(date +'%Y-%m-%d-%H-%M-%S')

# 规控节点
sleep 1
gnome-terminal --tab -- bash -c "ros2 launch hybrid_a_star_debug replan.launch.py > LOGS/$day/${time}.log; exec bash"
sleep 1
gnome-terminal --tab -- bash -c "rviz2 -d /home/xhzn_taomin/config/simulation.rviz; exec bash"
# map_server
gnome-terminal --tab -- bash -c "ros2 run nav2_map_server map_server --ros-args --param yaml_filename:=$ws_path/map/map.yaml; exec bash"
sleep 2
gnome-terminal --tab -- bash -c "ros2 lifecycle set /map_server configure; exec bash"
sleep 2
gnome-terminal --tab -- bash -c "ros2 lifecycle set /map_server activate; exec bash"

